package com.yuwubao.uav.tool.service.impl;

import com.yuwubao.framework.bean.PageData;
import com.yuwubao.uav.tool.mapper.FileDownloadMapper;
import com.yuwubao.uav.tool.mapper.TaskMapper;
import com.yuwubao.uav.tool.mapper2.TaskMapper2;
import com.yuwubao.uav.tool.service.FileDownloadService;
import com.yuwubao.uav.tool.service.TaskService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 *
 */
@Service
public class FileDownloadServiceImpl implements FileDownloadService {

    private static final Logger logger = LogManager.getLogger(FileDownloadServiceImpl.class.getName());

    @Resource
    private FileDownloadMapper fileDownloadMapper;

    @Override
    public void deleteFile(PageData pageData) throws Exception {
        try{
            fileDownloadMapper.deleteFile(pageData);
        }catch (Exception e) {
            logger.debug("",e);
        }
    }
    @Override
    public void updateFile(PageData pageData) throws Exception {
        try{
            fileDownloadMapper.updateFile(pageData);
        }catch (Exception e) {
            logger.debug("",e);
            e.printStackTrace();
        }
    }
    @Override
    public void addFile(PageData pageData) throws Exception {
        try{
            fileDownloadMapper.addFile(pageData);
        }catch (Exception e) {
            logger.debug("",e);
        }
    }

    @Override
    public List<PageData> listFile(PageData pageData) throws Exception {
        try{
            return fileDownloadMapper.listFile(pageData);
        }catch (Exception e) {
            logger.debug("",e);
        }
        return null;
    }
    @Override
    public int listFileCount(PageData pageData) throws Exception {
        try{
            return fileDownloadMapper.listFileCount(pageData);
        }catch (Exception e) {
            logger.debug("",e);
        }
        return 0;
    }
}
